<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .q1{
            height: 600px;
            background: #000;
        }
        .q2{
            width: 234px;
            height: 234px;
            margin: 0 auto;
            background-color: hotpink;
            /*可以做吸顶效果*/
            position: sticky;
            top: 0;
        }
        .q3{
            height: 2000px;
            background: greenyellow;
        }
    </style>
</head>
<body>
    <div class="q1"></div>
    <div class="q2"></div>
    <div class="q3"></div>
</body>
</html>